home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / GameKit / Examples / NX_Invaders / NXIPlayer.h < prev    next >
Encoding:
Text File  |  1995-06-12  |  1.1 KB  |  41 lines

  1.  
  2. // Handles moving and rendering the base, whether under player or demo control.
  3.  
  4. #import <gamekit/gamekit.h>
  5.  
  6. #define BASE_WIDTH    30
  7. #define BASE_HEIGHT    20
  8.  
  9. // how fast the base can move
  10. #define BASE_STEPS    2
  11.  
  12. #define BASE_DYING    (GK_DEAD_ACTOR + 2)
  13. #define BASE_DEAD    GK_DEAD_ACTOR
  14. #define BASE_ALIVE    (GK_DEAD_ACTOR + 1)
  15. #define BASE_FRAMES    8
  16.  
  17. #define BASE_DIE_DELAY_SIZE    1    // how many dead cycles while base dies
  18.  
  19. #define NXI_LEFTKEY        0
  20. #define NXI_RIGHTKEY    1
  21. #define NXI_FIREKEY        2
  22.  
  23. @interface NXIPlayer:GKActor
  24. {
  25.     id  basesLeft;        // PlayerUpView
  26.     BOOL playerStopped;
  27.     float xdirection, screenWidth;
  28.     NXEvent keys[3];
  29. }
  30.  
  31. - init;                        // initialize the player
  32. - (BOOL)newPlayer;            // get and set up a new base.  Returns NO if can't
  33. - resetPlayer;                // reset all player info
  34. - move:sender;                // Move the base one animation frame
  35. - demoMove:sender;            // Move the base one animation frame (demo cntl)
  36. - collidedWith:anActor;        // called when it is detected that we hit something
  37. - updateDrawingState;        // change the internal state machine (ie. advance
  38. - setDirection:(int)newDirection;    // sent by GameView at right time
  39.  
  40. @end
  41.